#!/usr/bin/env bash
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
parsed=$(getopt -o "${common_getopt_flags}" -l "$common_getopt_flags_long" -- "$@")
eval set -- "$parsed"
while true; do
  case "$1" in
    *)
      common_getopt_case "$@"
      ;;
  esac
done
executable="$1"
common_setup
"${common_host_dir}/usr/bin/${common_arch}-linux-gdb" \
  -q \
  -ex "set sysroot ${common_buildroot_out_dir}/staging" \
  -ex "target remote localhost:${common_qemu_hostfwd_generic_port}" \
  -ex 'tb main' \
  -ex 'c' \
  "${common_build_dir}/${executable}" \
;
